package com.touchyourheart.model.bean;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "user_hand_made_like")
public class UserHandMadeLike implements Serializable {

  private static final long serialVersionUID = 8564692795295563265L;

  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private long id;

  @ManyToOne
  @JoinColumn(name = "user_id_fk", foreignKey = @ForeignKey(name = "uhml_user_id_fk"))
  private User user;

  @ManyToOne
  @JoinColumn(name = "hand_made_id_fk", foreignKey = @ForeignKey(name = "uhml_hand_made_id_fk"))
  private HandMade handMade;

  @Column(name = "create_time", nullable = false)
  @Temporal(TemporalType.TIMESTAMP)
  private Date createTime;

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public User getUser() {
    return user;
  }

  public void setUser(User user) {
    this.user = user;
  }

  public HandMade getHandMade() {
    return handMade;
  }

  public void setHandMade(HandMade handMade) {
    this.handMade = handMade;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

}
